package il.technion.math.zipfdistribution;

public class IndexedDouble implements Comparable<Object>{
	public final Double value;
	public final int index;
	public IndexedDouble(double v, int i)
	{
		this.value = v;
		this.index = i;
	}
	@Override
	public boolean equals(Object arg0) {
		return compareTo(arg0)==0;
	}

	@Override
	public int compareTo(Object arg0) {
		if(arg0 instanceof Double)
			return value.compareTo((Double) arg0);
		if(arg0 instanceof IndexedDouble)
			return value.compareTo(((IndexedDouble) arg0).value);
		return -1;
	}
	

}
